package cn.data.stream.config.parse;

import cn.data.stream.enums.StreamType;
import java.util.List;
import java.util.StringJoiner;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import lombok.Data;

/**
 * @author shi hong yu
 */
@XmlAccessorType(XmlAccessType.FIELD)
@Data
public class ComponentNode {

    @XmlAttribute(name = "name",required = true)
    private String name;
    @XmlAttribute(name = "beanName",required = true)
    private String beanName;
    @XmlElement(name = "output")
    private List<String> outputs;

    private StreamType type;

    @Override
    public String toString() {
        return new StringJoiner(", ", type+" [", "]")
            .add("name='" + name + "'")
            .add("beanName='" + beanName + "'")
            .add("outputs=" + outputs)

            .toString();
    }
}
